<li>
	<a href="javascript:" id="btnOnline" data-href="${ctx}/sys/online/list" data-title="${text('在线人员')}" title="${text('在线人员')}"
		class="${hasPermi('sys:online:view') ? 'addTabPage' : ''} " data-placement="bottom" data-container="body">
		<i class="icon-people"></i><span id="onlineCount" class="label label-success">0</span>
	</a>
	<script>
		function refreshOnlineCount(){
			function ajaxCallback(data) {
				if (data && data.message){
					if (data.result == 'false' || data.result == 'login') {
						if (window.rocInt) clearInterval(window.rocInt);
						if (window.ppmInt) clearInterval(window.ppmInt);
					}
					js.confirm(data.message, function(){
						location.reload(true);
					});
				}
				let num = Number(data || 0);
				try{$('#onlineCount').html(num !== num ? 0 : num)}catch(e){}
			}
			$.ajax({
				url: ctx+'/sys/online/count?__notUpdateSession=true&__t=' + new Date().getTime(),
				method: 'GET',
				success: function(data) {
					ajaxCallback(data);
				},
				error: function(jqXHR) {
					try {
						ajaxCallback(JSON.parse(jqXHR.responseText));
					} catch (e) {
						ajaxCallback({message: jqXHR.responseText});
					}
				}
			});
		}
		refreshOnlineCount(); // 先执行一次
		window.rocInt = setInterval(refreshOnlineCount, 180000); // 3分钟执行一次
		$(function(){$('#btnOnline').tooltip()});
	</script>
</li>